﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Linq.Expressions;

namespace TfsBacklogMgr.Main
{

    [NotifyPropertyChanged]
    public abstract class ViewModelBase : INotifyPropertyChanged
    {

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this,
                                      new PropertyChangedEventArgs(propertyName));
            }
        }


        //protected bool SetField<T>(ref T field, T value, Expression<Func<T>> selectorExpression)
        //{
        //    return true;
        //}

        //protected bool SetField<T>(ref T field, T value, Expression<Func<T>> selectorExpression, string secondaryPropertyName)
        //{
        //    return true;
        //}

        //protected void OnPropertyChanged(string name)
        //{
        //}

        protected void OnPropertyChanged(string name, string name2)
        {
            OnPropertyChanged(name);
            OnPropertyChanged(name2);
        }
    }
}
